using Microsoft.EntityFrameworkCore;
using OrchardCore.Data;

namespace OrchardCore.Data.EFCore.Options;

/// <summary>
/// EF Core配置选项
/// 定义EF Core数据访问的配置参数
/// </summary>
public class EFCoreOptions
{
    /// <summary>
    /// 命令批处理大小
    /// </summary>
    public int CommandsPageSize { get; set; } = 500;

    /// <summary>
    /// 是否启用查询门控
    /// </summary>
    public bool QueryGatingEnabled { get; set; } = true;

    /// <summary>
    /// 是否启用线程安全检查
    /// </summary>
    public bool EnableThreadSafetyChecks { get; set; } = true;

    /// <summary>
    /// 是否启用详细日志
    /// </summary>
    public bool EnableDetailedErrors { get; set; }

    /// <summary>
    /// 是否启用敏感数据日志
    /// </summary>
    public bool EnableSensitiveDataLogging { get; set; }

    /// <summary>
    /// 是否启用查询缓存
    /// </summary>
    public bool EnableQueryCache { get; set; } = true;

    /// <summary>
    /// 查询缓存大小
    /// </summary>
    public int QueryCacheSize { get; set; } = 1000;

    /// <summary>
    /// 是否启用自动迁移
    /// </summary>
    public bool EnableAutoMigrations { get; set; } = true;

    /// <summary>
    /// 迁移程序集名称
    /// </summary>
    public string MigrationAssembly { get; set; }

    /// <summary>
    /// 迁移命名空间
    /// </summary>
    public string MigrationNamespace { get; set; }

    /// <summary>
    /// 是否启用并发检查
    /// </summary>
    public bool EnableConcurrencyCheck { get; set; } = true;

    /// <summary>
    /// 是否启用延迟加载
    /// </summary>
    public bool EnableLazyLoading { get; set; }

    /// <summary>
    /// 是否启用代理创建
    /// </summary>
    public bool EnableProxyCreation { get; set; }

    /// <summary>
    /// 是否启用变更跟踪
    /// </summary>
    public bool EnableChangeTracking { get; set; } = true;

    /// <summary>
    /// 是否启用自动检测变更
    /// </summary>
    public bool EnableAutoDetectChanges { get; set; } = true;

    /// <summary>
    /// 是否启用验证
    /// </summary>
    public bool EnableValidation { get; set; } = true;
} 